<template>
  <!-- 开票管理 -->
  <div class="bsh">
    <div class="sh">
      <div class="search">
        <el-form :inline="true" :model="search" class="demo-form-inline">
          <el-form-item label="输入搜索">
            <el-input
              v-model="search.key"
              placeholder="请输入设备名称"
            ></el-input>
          </el-form-item>
          <el-form-item label="输入时间">
            <el-date-picker
              v-model="search.time"
              @change="chage"
              format="yyyy-MM-dd"
              value-format="yyyy-MM-dd"
              type="daterange"
              range-separator="-"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
            ></el-date-picker>
          </el-form-item>
          <el-form-item
          >
            <el-button type="primary"
            >查询
            </el-button
            >
          </el-form-item
          >
        </el-form>
      </div>
      <el-table stripe class="table" :data="tableData" style="width: 100%" height="520">
        <el-table-column prop="applyTime" label="申请时间" align="center"></el-table-column>
        <el-table-column prop="type" label="审核类型" align="center" width="180">
          <template v-slot="scope">
            <span v-show="scope.row.type==16">采购开票</span>
            <span v-show="scope.row.type==17">采购付款</span>
            <span v-show="scope.row.type==24">站点开票</span>
            <span v-show="scope.row.type==25">站点付款</span>
          </template>
        </el-table-column>
        <el-table-column prop="siteName" label="申请部门" align="center"></el-table-column>
        <el-table-column prop="userName" label="申请人" align="center"></el-table-column>
        <el-table-column prop="shengheStatus" label="状态" align="center">
          <template v-slot="scope">
            <span v-show="scope.row.shengheStatus==1">待审核</span>
            <span v-show="scope.row.shengheStatus==2">驳回</span>
            <span v-show="scope.row.shengheStatus==3">已完成</span>
          </template>
        </el-table-column>
        <el-table-column label="操作" align="center" width="200">
          <template slot-scope="scope">
            <el-button
              v-if="scope.row.shengheStatus==1"
              type="warning"
              size="mini"
              @click="confirm(scope.row.type,isDetail=1,scope.row)"
            >审核
            </el-button>
            <el-button
              type="primary"
              size="mini"
              @click="confirm(scope.row.type,isDetail=2,scope.row)"
            >详情
            </el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <!--============================分页===================================================-->
    <div class="pgnt">
      <el-pagination
        background
        layout="prev, pager, next"
        :current-page="Pagination.current"
        :page-size="Pagination.pagesize"
        @current-change="handleCurrentChange"
        :page-count="Pagination.total"
      ></el-pagination>
    </div>
    <!--弹框-->
    <!--开票、付款 -->
    <el-dialog
      title="详情"
      :visible.sync="dialogVisible_kaipiao_fukuang"
      width="76%"
      :modal-append-to-body="false">
      <template>
        <ul v-show="global_status==3||global_status==4" class="el-inputbox">
          <li>
            <span>站点名称</span>
            <el-input style="width: 68%;" disabled v-model="custom_info.siteName"></el-input>
          </li>
          <li>
            <span>联系人</span>
            <el-input style="width: 68%;" disabled v-model="custom_info.contactPerson"></el-input>
          </li>
          <li>
            <span>联系方式</span>
            <el-input style="width: 68%;" disabled v-model="custom_info.phone"></el-input>
          </li>
          <li>
            <span>总金额</span>
            <el-input style="width: 68%;" disabled v-model="custom_info.totalMoney"></el-input>
          </li>
        </ul>
        <ul v-show="global_status==3||global_status==4" class="el-inputbox">
          <li>
            <span>已付款金额</span>
            <el-input style="width: 68%;" disabled v-model="custom_info.paymentMoney"></el-input>
          </li>
          <li>
            <span>剩余付款金额</span>
            <el-input style="width: 68%;" disabled v-model="custom_info.lastPaymentMoney"></el-input>
          </li>
          <li>
            <span>申请中金额</span>
            <el-input style="width: 68%;" disabled v-model="custom_info.applyPaymentMoney"></el-input>
          </li>
          <li>
            <span>本次付款金额</span>
            <el-input disabled style="width: 68%;" v-model="paymentMoneyNow"></el-input>
          </li>
        </ul>
      </template>
      <template>
        <el-table
          :data="tableData_repairLog"
          style="width: 100%">
          <el-table-column
            type="index"
            label="序号"
            align="center"
          width="140">
          </el-table-column>
          <el-table-column
            prop="applyTime" align="center"
            label="维修日期">
            <template v-slot="scope">
              <span>{{ dateFormat("yyyy-MM-dd", scope.row.applyTime) }}</span>
            </template>
          </el-table-column>
          <el-table-column
            prop="productName" align="center"
            label="零件名称">
          </el-table-column>
          <el-table-column
            prop="productTuhao" align="center"
            label="零件图号">
          </el-table-column>
          <el-table-column
            prop="number" align="center"
            label="数量">
          </el-table-column>
          <el-table-column
            prop="returnNumber" align="center"
            label="返件总量">
          </el-table-column>
          <el-table-column
            prop="danjia" align="center"
            label="单价（元）">
          </el-table-column>
          <el-table-column
            prop="chalvfei" align="center"
            label="管理费（元）">
          </el-table-column>
          <el-table-column
            prop="money" align="center"
            label="金额（元）">
          </el-table-column>
          <el-table-column
            prop="chalvfei" align="center"
            label="差旅费（元）">
          </el-table-column>
          <el-table-column
            prop="qitafeiyong" align="center"
            label="其他费用">
          </el-table-column>
        </el-table>
      </template>
      <template>
        <el-table
          :data="tableData_detail_kaipiaoLog"
          style="width: 100%">
          <el-table-column
            type="index"
            label="序号"
            align="center"
          width="140">
          </el-table-column>
          <el-table-column
            label="开票时间"
            prop="kaipiaoTime"
            align="center">
            <template v-slot="scope">
              <div>{{ dateFormat("yyyy-MM-dd", scope.row.kaipiaoTime) }}</div>
            </template>
          </el-table-column>
          <el-table-column
            label="开票号"
            prop="piaoNumber"
            align="center">
          </el-table-column>
          <el-table-column
            prop="money"
            label="开票额"
            align="center">
          </el-table-column>
          <el-table-column
            label="状态"
            align="center">
            <template v-slot="scope">
              <span v-if="scope.row.status==1" style="color: red">待审核</span>
              <span v-if="scope.row.status==2" >已驳回</span>
              <span v-if="scope.row.status==3">已完成</span>
            </template>
          </el-table-column>
        </el-table>
        <div class="piaomian">
          <span>票面总额</span>
          <el-input disabled style="width: 10%;" v-model="faFaceValue"></el-input>
        </div>
      </template>
      <template>
        <p v-show="global_status==3||global_status==4" class="huizo">付款记录 :</p>
        <template>
          <el-table
            v-show="global_status==3||global_status==4"
            :data="tableData_paymentLog"
            style="width: 100%">
            <el-table-column
              type="index"
              align="center"
              label="序号"
            width="140">
            </el-table-column>
            <el-table-column
              prop="money" align="center"
              label="付款金额">
            </el-table-column>
            <el-table-column
              align="center"
              label="付款时间">
              <template v-slot="scope">{{ dateFormat("yyyy-MM-dd", scope.row.createonTime) }}</template>
            </el-table-column>
            <el-table-column
              label="状态" align="center">
              <template v-slot="scope">
                <span v-if="scope.row.status==1">待审核</span>
                <span v-if="scope.row.status==2" style="color: red">驳回</span>
                <span v-if="scope.row.status==3">已完成</span>
              </template>
            </el-table-column>
          </el-table>
        </template>
      </template>
      <span slot="footer" class="dialog-footer">
        <el-button v-show="isDetail==1" @click="dialogVisible_kaipiao_fukuang = false;confirm_kaipiao_fukuan(3)"
                   type="primary">确 定</el-button>
        <el-button v-show="isDetail==1" @click="show_BoHui">驳 回</el-button>
        <el-button v-show="isDetail==2" @click="dialogVisible_kaipiao_fukuang = false">取 消</el-button>
  </span>
    </el-dialog>
    <!-- 开票 付款驳回   -->
    <el-dialog
      title="驳回"
      :visible.sync="dialogVisible_turnDown"
      width="30%"
      :modal-append-to-body="false">
      <span>驳回理由 : </span>
      <el-input style="width: 80%" v-model="bohui" placeholder="请输入驳回理由"></el-input>
      <span slot="footer" class="dialog-footer">
    <el-button type="primary" @click="dialogVisible_turnDown = false ,confirm_kaipiao_fukuan(4)">确 定</el-button>
    <el-button @click="dialogVisible_turnDown = false">取 消</el-button>
  </span>
    </el-dialog>
    <!--=================采购开票=========================================-->
    <el-dialog :visible.sync="dialog_PurchaseKaiPiao" :modal-append-to-body="false" width="1300px">
      <div class="herd_bud"></div>
      <div class="from_bt">开票详情</div>
      <!--供应商-->
      <div style="height: 70px">
        <el-form :inline="true" :model="PurchaseKaiPiao_fromDataSupplier" style="height: 100%">
          <el-form-item label="供应商名称">
            <el-input disabled v-model="PurchaseKaiPiao_fromDataSupplier.supplierName"></el-input>
          </el-form-item>
          <el-form-item label="联系人">
            <el-input disabled v-model="PurchaseKaiPiao_fromDataSupplier.lianxiren"></el-input>
          </el-form-item>
          <el-form-item label="联系方式">
            <el-input disabled v-model="PurchaseKaiPiao_fromDataSupplier.phone"></el-input>
          </el-form-item>
          <el-form-item label="总金额">
            <el-input disabled v-model="PurchaseKaiPiao_fromDataSupplier.moneySum"></el-input>
          </el-form-item>
        </el-form>
      </div>
      <!--本次审核的开票的信息-->
      <div
        style="font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;font-size: 14px;width: 100%;margin-top: 15px">
        开票审核 ：
      </div>
      <div class="purInfo002" style="margin-top: 15px">
        <el-table :data="PurchaseKaiPiao_tableDataKaiPiao"
                  width="100%"
                  height="300px"
                  :max-height="150"
                  :row-style="{height:'37px'}"
        >
          <el-table-column type="index" width="150" align="center" label="序号"></el-table-column>
          <el-table-column prop="piaoNumber" label="票号" align="center">
          </el-table-column>
          <el-table-column prop="kaipiaoTime" label="开票时间" align="center">
            <template v-slot="scope">
              <div>{{ geshiTime(scope.row.kaipiaoTime) }}</div>
            </template>
          </el-table-column>
          <el-table-column prop="status" label="状态" align="center">
            <template v-slot="scope">
              <div v-if="scope.row.status==1" style="color: red">待审核</div>
              <div v-if="scope.row.status==2">驳回</div>
              <div v-if="scope.row.status==3">已完成</div>
            </template>
          </el-table-column>
          <el-table-column prop="money" label="发票金额" align="center">
          </el-table-column>
        </el-table>
      </div>
      <!--开票记录-->
      <div
        style="font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;font-size: 14px;width: 100%;margin-top: 15px">
        开票记录 ：
      </div>
      <div class="purInfo002" style="margin-top: 15px">
        <el-table :data="PurchaseKaiPiao_tableDataKaiPiaoLog"
                  width="100%"
                  height="300px"
                  :max-height="150"
                  :row-style="{height:'37px'}"
        >
          <el-table-column type="index" width="150" align="center" label="序号"></el-table-column>
          <el-table-column prop="piaoNumber" label="票号" align="center">
          </el-table-column>
          <el-table-column prop="kaipiaoTime" label="开票时间" align="center">
            <template v-slot="scope">
              <div>{{ geshiTime(scope.row.kaipiaoTime) }}</div>
            </template>
          </el-table-column>
          <el-table-column prop="status" label="状态" align="center">
            <template v-slot="scope">
              <div v-if="scope.row.status==1" >待审核</div>
              <div v-if="scope.row.status==2" style="color: red">驳回</div>
              <div v-if="scope.row.status==3">已完成</div>
            </template>
          </el-table-column>
          <el-table-column prop="money" label="发票金额" align="center">
          </el-table-column>
        </el-table>
      </div>
      <div class="from_tab_btn" style="display:flex;justify-content: center;align-items: center; padding-top: 10px ">
        <el-button v-if="isDetail==1" @click="pass_kaipiao(1)" type="primary" size="small">确 认</el-button>
        <el-button v-if="isDetail==1" @click="disAllowance_kaipiao()" type="primary" size="small">驳 回
        </el-button>
        <el-button v-if="isDetail==2" @click="dialog_PurchaseKaiPiao = false" type="info" size="small">取 消
        </el-button>
      </div>
    </el-dialog>

    <!--=================付款=========================================-->
    <el-dialog :visible.sync="dialog_PurchaseFuKuan" :modal-append-to-body="false" width="1300px">
      <div class="herd_bud"></div>
      <div class="from_bt" style="padding-bottom: 20px;">付款详情</div>
      <!--供应商-->
      <div style="height: 100px">
        <el-form :inline="true" :model="PurchaseFuKuan_fromDataSupplier" style="height: 100%">
          <el-form-item label="供应商名称">
            <el-input disabled v-model="PurchaseFuKuan_fromDataSupplier.supplierName"></el-input>
          </el-form-item>
          <el-form-item label="联系人">
            <el-input disabled v-model="PurchaseFuKuan_fromDataSupplier.lianxiren"></el-input>
          </el-form-item>
          <el-form-item label="联系方式">
            <el-input disabled v-model="PurchaseFuKuan_fromDataSupplier.phone"></el-input>
          </el-form-item>
          <el-form-item label="总金额">
            <el-input disabled v-model="PurchaseFuKuan_fromDataSupplier.moneySum"></el-input>
          </el-form-item>
          <br>
          <el-form-item label="本次付款金额">
            <el-input disabled v-model="PurchaseFuKuan_fromDataSupplier.jieSuanMoneyNow"></el-input>
          </el-form-item>
        </el-form>
      </div>
      <!--付款记录-->
      <div
        style="font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';font-weight: 700;font-size: 14px;width: 100%;margin-top: 15px">
        开票记录 ：
      </div>
      <div class="purInfo002" style="margin-top: 15px">
        <el-table :data="PurchaseFuKuan_tableDataFuKuanLog"
                  width="100%"
                  height="300px"
                  :max-height="150"
                  :row-style="{height:'37px'}"
        >
          <el-table-column type="index" align="center" label="序号" width="140"></el-table-column>
          <el-table-column prop="fukuanMoney" label="付款金额" align="center">
          </el-table-column>
          <el-table-column prop="status" label="状态" align="center">
            <template slot-scope="scope">
              <span v-if="scope.row.status==1">待审核</span>
              <span v-if="scope.row.status==2" style="color: red">驳回</span>
              <span v-if="scope.row.status==3">已通过</span>
            </template>
          </el-table-column>
          <el-table-column prop="createonTime" label="付款时间" align="center">
            <template v-slot="scope">
              <div>{{ geshiTime(scope.row.createonTime) }}</div>
            </template>
          </el-table-column>
        </el-table>
      </div>
      <div class="from_tab_btn" style="display:flex;justify-content: center;align-items: center; margin-top: 20px;">
        <el-button v-if="isDetail==1" @click="pass_fukuan(1)" type="primary" size="small">确 认</el-button>
        <el-button v-if="isDetail==1" @click="disAllowance_fukuan()" type="primary" size="small">驳 回
        </el-button>
        <el-button v-if="isDetail==2" @click="dialog_PurchaseFuKuan = false" type="info" size="small">取 消
        </el-button>
      </div>
    </el-dialog>
    <!--付款-->
    <el-dialog
      title="驳回理由"
      :visible.sync="dialogVisible_refuse_FuKuan"
      width="30%"
      append-to-body>
      <el-input v-model="bohui"></el-input>
      <span slot="footer" class="dialog-footer">
    <el-button @click="dialogVisible_refuse_FuKuan = false">取 消</el-button>
    <el-button type="primary" @click="pass_kaipiao(2)">确 定</el-button>
  </span>
    </el-dialog>
    <!--驳回开票-->
    <el-dialog
      title="驳回理由"
      :visible.sync="dialogVisible_refuse_KaiPiao"
      width="30%"
      append-to-body>
      <el-input v-model="bohui"></el-input>
      <span slot="footer" class="dialog-footer">
    <el-button @click="dialogVisible_refuse_KaiPiao = false">取 消</el-button>
    <el-button type="primary" @click="pass_kaipiao(2)">确 定</el-button>
  </span>
    </el-dialog>
  </div>
</template>

<script>
import axios from 'axios'

export default {
  inject: ['reload'],
  data() {
    return {
      isDetail: 1,
      dialogVisible_kaipiao_fukuang: false,
      dialogVisible_turnDown: false,
      dialog_PurchaseKaiPiao: false,
      dialogVisible_refuse_KaiPiao: false,
      dialog_PurchaseFuKuan: false,//付款
      dialogVisible_refuse_FuKuan: false,//驳回
      global_status: null,
      custom_info: {},
      faFaceValue: 0,
      bohui: "",
      tableData_detail_kaipiaoLog: [],
      tableData_repairLog: [],
      paymentMoneyNow: 0,
      tableData_paymentLog: [],
      //模块的集合
      search: {key: "", start: "", end: ""},
      Pagination: {
        beginTime: "",
        endTime: "",
        key: "",
        total: 1,//总共页
        current: 1,//当前页
        pagesize: 10,//页面数据个数
      },

      tableData: [{}],

      PurchaseKaiPiao_fromDataSupplier: {},//开票供应商的基本信息
      PurchaseKaiPiao_tableDataKaiPiao: [],
      PurchaseKaiPiao_tableDataKaiPiaoLog: [],
      PurchaseFuKuan_fromDataSupplier: {},//付款供应商的基本信息
      PurchaseFuKuan_tableDataFuKuanLog: [],
    };
  },
  created() {
    this.getList()
  },
  methods: {
    pass_fukuan(type) {
      let statue = type == 1 ? 3 : 2
      const message = JSON.parse(localStorage.getItem("message"))
      if (type == 2) {
        if (this.bohui == "") {
          this.$message.error("驳回理由不能为空！");
          return;
        }
      }
      const param = {
        "bohui": this.bohui,
        "checkFolwId": this.PurchaseFuKuan_fromDataSupplier.checkFolwId,
        "shengheMessageId": this.PurchaseFuKuan_fromDataSupplier.id,
        "status": statue,
        "userId": message.Id,
        "userName": message.Name
      }
      console.log(param)
      axios.post("/JX_java/procurement/caigoushenghe/updatestatus", param).then(res => {
        console.log(res.data.data);
        if (res.data.data == "操作成功") {
          this.$message.success(res.data.data);
          this.reload();
          this.dialog_PurchaseFuKuan = false;
        } else {
          this.$message.error(res.data.data);
        }
      })

    },
    disAllowance_fukuan() {
      this.bohui = ""
      this.dialog_PurchaseFuKuan = false;
      this.dialogVisible_refuse_FuKuan = true;
    },
    pass_kaipiao(type) {
      let statue = type == 1 ? 3 : 2
      const message = JSON.parse(localStorage.getItem("message"))
      if (type == 2) {
        if (this.bohui == "") {
          this.$message.error("驳回理由不能为空！");
          return;
        }
      }
      const param = {
        "bohui": this.bohui,
        "checkFolwId": this.PurchaseKaiPiao_fromDataSupplier.checkFolwId,
        "shengheMessageId": this.PurchaseKaiPiao_fromDataSupplier.id,
        "status": statue,
        "userId": message.Id,
        "userName": message.Name
      }
      console.log(param)
      // return
      axios.post("/JX_java/procurement/caigoushenghe/updatestatus", param).then(res => {
        console.log(res.data.data);
        if (res.data.data == "操作成功") {
          this.$message.success(res.data.data);
          this.dialog_PurchaseKaiPiao = false;
          this.getList()
        } else {
          this.$message.error(res.data.data);
        }
      })
    },
    disAllowance_kaipiao() {
      this.bohui = ""
      this.dialog_PurchaseKaiPiao = false;
      this.dialogVisible_refuse_KaiPiao = true;
    },
    show_BoHui() {
      this.dialogVisible_kaipiao_fukuang = false
      this.dialogVisible_turnDown = true

    },
    confirm_kaipiao_fukuan(status) {
      let message = JSON.parse(localStorage.getItem("message"));
      let param = {
        "bohui": this.bohui,
        "checkFolwId": this.global_checkFlowId,
        "shengheMessageId": this.global_id,
        "status": status,
        "userId": message.Id,
        "userName": message.Name
      }
      console.log(param)
      axios.post("/JX_java/procurement/caigoushenghe/updatestatus", param).then(res => {
        if (res.data.data == "操作成功") {
          this.$message.success(res.data.data);
          this.reload();
          this.dialogVisible_kaipiao_fukuang = false
        } else {
          this.$message.error(res.data.data);
        }
      })
    },
    //时间格式
    dateFormat(format, time) {
      var t = new Date(time)
      var tf = function (i) {
        return (i < 10 ? '0' : '') + i
      }
      return format.replace(/yyyy|MM|dd|HH|mm|ss/g, function (a) {
        switch (a) {
          case 'yyyy':
            return tf(t.getFullYear())
          // break
          case 'MM':
            return tf(t.getMonth() + 1)
          // break
          case 'mm':
            return tf(t.getMinutes())
          // break
          case 'dd':
            return tf(t.getDate())
          // break
          case 'HH':
            return tf(t.getHours())
          // break
          case 'ss':
            return tf(t.getSeconds())
          // break
        }
      })
    },
    confirm(type, statue, e) {
      console.log(type, statue, e)
      if (type == 16) {
        console.log(e, 33333333333333)
        this.dialog_PurchaseKaiPiao = true
        axios.get("/JX_java/procurement/caigoushenghe/getshengHeDetails?shengheMessageId=" + e.id + "&&checkFlowId=" + e.checkFolwId).then(res => {
          console.log(res.data.data.pojo, "数据")
          this.PurchaseKaiPiao_fromDataSupplier.id = e.id
          this.PurchaseKaiPiao_fromDataSupplier.checkFolwId = res.data.data.checkFlowId
          this.PurchaseKaiPiao_fromDataSupplier.supplierName = res.data.data.pojo.supplierName
          this.PurchaseKaiPiao_fromDataSupplier.lianxiren = res.data.data.pojo.lianxiren
          this.PurchaseKaiPiao_fromDataSupplier.phone = res.data.data.pojo.phone
          this.PurchaseKaiPiao_fromDataSupplier.moneySum = res.data.data.pojo.moneySum
          const kaipiaos = res.data.data.pojo.kaipiaos
          kaipiaos.forEach(e => {
            console.log(e)
            if (e.status == 1) {//本次审核的开票
              this.PurchaseKaiPiao_tableDataKaiPiao.push(e)
            } else {//开票历史记录
              this.PurchaseKaiPiao_tableDataKaiPiaoLog.push(e)
            }
          })
        })
      }
      if (type == 17) {//付款审核
        axios.get("/JX_java/procurement/caigoushenghe/getshengHeDetails?shengheMessageId=" + e.id + "&&checkFlowId=" + e.checkFolwId).then(res => {
          console.log(res.data.data, 34343444444444444444444)
          this.PurchaseFuKuan_fromDataSupplier.checkFolwId = res.data.data.checkFlowId
          this.PurchaseFuKuan_fromDataSupplier.id = e.id
          this.PurchaseFuKuan_fromDataSupplier.supplierName = res.data.data.pojo.supplierName
          this.PurchaseFuKuan_fromDataSupplier.lianxiren = res.data.data.pojo.lianxiren
          this.PurchaseFuKuan_fromDataSupplier.phone = res.data.data.pojo.phone
          this.PurchaseFuKuan_fromDataSupplier.moneySum = res.data.data.pojo.moneySum
          this.PurchaseFuKuan_fromDataSupplier.jieSuanMoneyNow = res.data.data.pojo.jieSuanMoneyNow
          this.PurchaseFuKuan_tableDataFuKuanLog = res.data.data.pojo.fukuans
          this.dialog_PurchaseFuKuan = true
        })
      }
      if (type == 24) {
        this.isDetail = statue
        this.global_status = 2
        axios.get("/JX_java/procurement/caigoushenghe/getshengHeDetails?shengheMessageId=" + e.id + "&&checkFlowId=" + e.checkFolwId).then(res => {
          console.log(res.data.data)
          this.global_checkFlowId = e.checkFolwId
          let {partAndManpowers, invoiceTbs, kaipiaoMoney, status} = res.data.data.pojo
          this.global_id = e.id
          this.faFaceValue = kaipiaoMoney
          this.tableData_repairLog = partAndManpowers
          this.tableData_detail_kaipiaoLog = invoiceTbs
          this.dialogVisible_kaipiao_fukuang = true
        })
      }
      if (type == 25) {
        this.global_status = 3
        this.dialogVisible_kaipiao_fukuang = true
        axios.get("/JX_java/procurement/caigoushenghe/getshengHeDetails?shengheMessageId=" + e.id + "&&checkFlowId=" + e.checkFolwId).then(res => {
          this.global_checkFlowId = e.checkFolwId
          console.log(res.data.data.pojo)
          this.isDetail = statue
          let {
            paymentMoneyNow,
            siteInvoices,
            partAndManpowers,
            siteFukuans,
            totalMoney,
            paymentMoney,
            applyPaymentMoney,
            lastPaymentMoney,
            siteName,
            contactPerson,
            phone
          } = res.data.data.pojo;
          this.global_id = e.id
          this.custom_info.totalMoney = totalMoney
          this.custom_info.paymentMoney = paymentMoney
          this.custom_info.applyPaymentMoney = applyPaymentMoney
          this.custom_info.lastPaymentMoney = lastPaymentMoney
          this.custom_info.siteName = siteName
          this.custom_info.contactPerson = contactPerson
          this.custom_info.phone = phone
          this.tableData_repairLog = partAndManpowers
          this.tableData_detail_kaipiaoLog = siteInvoices
          this.tableData_paymentLog = siteFukuans
          this.faFaceValue = totalMoney
          this.paymentMoneyNow = paymentMoneyNow
          this.dialogVisible_kaipiao_fukuang = true
        })
      }
      console.log(type, statue, e);
    },
    getList() {
      const json = {
        beginTime: this.Pagination.start,
        endTime: this.Pagination.end,
        key: this.Pagination.key,
        pageNum: this.Pagination.current,
        pageSize: this.Pagination.pagesize,
      };
      axios
        .post(
          "/JX_java/common/getFinanceCheckList", json
        ).then((res) => {
        console.log(res.data.data, 11111111111111111111111111)
        this.Pagination.total = res.data.data.totalPages
        const result = res.data.data.content;
        this.tableData = result

        console.log(this.tableData, 111111)
        // this.clientIdarr = result;
      });
    },
//格式化时间
    geshiTime(date) {
      return date == null ? "" : date.substring(0, 10);
    },
    // 分页
    handleCurrentChange(e) {
      this.Pagination.current = e
      this.getList()
    },
    // 日期改变
    chage(e) {
      if (e) {
        this.Pagination.beginTime = e[0];
        this.Pagination.endTime = e[1];
      } else {
        this.Pagination.beginTime = '';
        this.Pagination.endTime = '';
      }
    },
    // 筛选
    onsubmit() {
      this.getList();
    }
  }
}
</script>

<style lang="scss" scoped>
.el-inputbox {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  color: #909399;
  margin-top: 20px;
  margin-bottom: 10px;

  li {

    width: 33%;
    font-size: 14px;
    margin-bottom: 10px;
    text-align: center;


    span {
      display: inline-block;
      width: 25%;
    }
  }
}

.search {
  height: 50px;
  border-radius: 5px;
  background-color: #fff;
  padding-left: 20px;
  padding-top: 10px;
  margin-bottom: 20px;
  overflow: hidden;
}

.ebtn {
  float: right;
  margin-right: 20px;
}

.tai {
  background: rgb(81, 103, 210);
}

.bsh {
  padding-left: 10px;
  padding-right: 10px;
}

.sh {
  background-color: #fff;
  border-radius: 10px;
}

.top {
  height: 120px;
  padding-left: 10px;
  padding-top: 20px;
  // margin-bottom: 20px;
  border-bottom: 1px solid #f5f5f5;
}

.shai {
  width: 190px;
  height: 90px;
  border-radius: 5px;
  border: 1px solid rgba(228, 228, 228, 1);
  float: left;
  margin-right: 20px;
  overflow: hidden;
  cursor: pointer;
}

.img {
  width: 50px;
  height: 50px;
  float: left;
  margin-left: 15px;
  margin-top: 15px;
  margin-right: 25px;
}

.img img {
  width: 50px;
  height: 50px;
}

.img2 {
  width: 45px;
  height: 45px;
  margin-top: 20px;
  margin-left: 20px;
  margin-right: 30px;
}

.img2 img {
  width: 45px;
  height: 45px;
}

.wenzi {
  float: left;
  margin-top: 15px;
  font-size: 28px;
  color: #0962a7;
  text-align: center;
}

.wenzi1 {
  float: left;
  margin-top: 15px;
  font-size: 28px;
  color: white;
  text-align: center;
}

.shu {
  margin-bottom: 5px;
  font-weight: 700;
}

.wen {
  text-align: center;
  line-height: 55px;
  font-size: 14px;
}

.shaixuan {
  height: 60px;
  margin-bottom: 20px;
  padding-left: 20px;
  color: #505050;
  border-bottom: 2px solid #f5f5f5;
}

.table {
  margin-bottom: 20px;
}

.pgnt {
  text-align: center;
}
</style>
